package com.ibm.sample.library.dao.impl;

import org.springframework.stereotype.Repository;

import com.ibm.sample.library.dao.ICategoryDao;
import com.ibm.sample.library.model.Category;

@Repository
public class CategoryDao extends GenericDao<Category> implements ICategoryDao
{
    public CategoryDao()
    {
        setType(Category.class);
    }

    @Override
    public Category getByName(String name)
    {
        return (Category) getSession().createQuery("from Category c where c.name = :name").setParameter("name", name).uniqueResult();
    }
}
